class User:

	def __init__(self, userId, username="", email="", bookList=[]):
		""" default constructor for Book """
		self._userId = userId
		self._username = username
		self._email = email
		self._bookList = bookList[:]
		
	def setUserId(self, userId):
		self._userId = userId
		
	def setUsername(self, username):
		self._username = username
		
	def setEmail(self, email):
		self._email = email
		
	def setBookList(self, bookList):
		self._bookList= bookList[:]
		
	def getUserId(self):
		return self._userId
		
	def getUsername(self):
		return self._username
		
	def getEmail(self):
		return self._email
		
	def getBookList(self):
		return self._bookList
		
	def addBookToList(self, bookid):
		maxCheckout = 2
		""" Add the book to this user's bookList """
		if len(self._bookList) >= maxCheckout:
			return False
		#if the bookid does not exists in the _bookList, add the bookid and return true
		elif bookid not in self._bookList:
			self._bookList.append(bookid)
			return True
		#else return false
		else:
			return False
		
	def removeBookFromList(self, bookid):
		""" Remove the book from this user's bookList """
		
		#if the bookid does not exist in the _bookList, return false
		if bookid not in self._bookList:
			return False
		else:
			self._bookList.remove(bookid)
			return True